<%-- 
    Document   : index
    Created on : 24/05/2012, 17:21:47
    Author     : Diogo, Gilvan, Lélandi e Lucas
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<f:view locale="#{localeController.currentLocale}">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
            <title><h:outputText value = "#{msg.tituloPagina}"/></title>
        </head>
        <body>
            <h:form>
                <center>       
                    <h1><h:outputText value = "#{msg.tituloPaginaInventario}"/></h1>
                    <hr/>
                    <h:dataTable value = "#{InventarioController.listaInventario}"
                                 var="item" border="0">

                        <h:column>
                            <center>
                                <f:facet name = "header">
                                    <h:outputText value = "#{msg.tituloNumeroSerie}"/>
                                </f:facet>
                                <h:outputText value= "#{item.numeroSerie}"/>
                            </center>
                        </h:column>

                        <h:column>
                            <center>
                                <f:facet name = "header">
                                    <h:outputText value = "#{msg.tituloColunaNome}"/>
                                </f:facet>
                                <h:outputText value = "#{item.nome}" />
                            </center>
                        </h:column>
                        
                        <h:column>
                            <center>
                                <f:facet name = "header">
                                    <h:outputText value = "#{msg.tituloColunaMarca}"/>
                                </f:facet>
                                <h:outputText value = "#{item.marca}" />
                            </center>
                        </h:column>

                        <h:column>
                            <center>
                                <f:facet name = "header">
                                    <h:outputText value = "#{msg.tituloColunaIp}"/>
                                </f:facet>
                                <h:outputText value = "#{item.endIp}" />
                            </center>
                        </h:column>

                        <h:column>
                            <center>
                                <f:facet name = "header">
                                    <h:outputText value = "#{msg.tituloColunaTipo}"/>
                                </f:facet>
                                <h:outputText value = "#{item.tipo}" />
                            </center>
                        </h:column>

                        <h:column>
                            <center>
                                <f:facet name = "header">
                                    <h:outputText value = "#{msg.tituloColunaDtCompra}"/>
                                </f:facet>
                                <h:outputText value= "#{item.dtCompra}">
                                    <f:convertDateTime pattern="dd/MM/yyyy"/>
                                </h:outputText>
                            </center>
                        </h:column>

                        <h:column>
                            <center>                       
                                <f:facet name = "header">
                                    <h:outputText value = "#{msg.tituloColunaValorCompra}"/>
                                </f:facet>
                                <h:outputText value = "#{item.valorCompra}" />
                            </center>
                        </h:column>

                        <!--Codigo para excluir item-->
                        <h:column>
                            <center>
                                <f:facet name="header">
                                    <h:outputText value="#{msg.tituloColunaExcluir}" />
                                </f:facet>
                                <h:commandButton value="#{msg.tituloLinkExcluir}" action="#{InventarioController.excluirAtivo}"/>
                            </center>
                        </h:column>
                    </h:dataTable>
                    <h:commandButton value = "#{msg.tituloBotaoCancelar}" action="voltar" />
                </center>
            </h:form>
        </body>
    </html>
</f:view>
